package com.jdiv.internalList;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import javax.swing.ImageIcon;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class JDivBennuGraph {

	private int listCount = 0;
	Map<Integer,List<TextureRegion>> sprites;
	
	public JDivBennuGraph () {
		sprites = new TreeMap<Integer,List<TextureRegion>>();
	}
	
	public int loadPNG(String path) {
		
		int ret = 0;
		ImageIcon i = new ImageIcon(path);
		int h = i.getIconHeight();
		int w = i.getIconWidth();
		Texture texture = new Texture(Gdx.files.internal(path));
		TextureRegion region = new TextureRegion(texture,0,0,w,h);
		List<TextureRegion> list = this.sprites.get(0);
		if (list == null) {
			list = new ArrayList<TextureRegion>();
			sprites.put(0, list);
		}
		list.add(region);
		ret = list.size() - 1;
		return ret;
		
	}
	
}
